import { Table, Button, Space, Divider } from 'ant-design-vue';
import { format } from '@/utils/format'


export const tableSchemas = [
  {
    title: '编号',
    dataIndex: 'id',
    key: 'id',
    align: 'center',
    width: 80,
  },
  {
    title: '用户',
    dataIndex: 'user',
    key: 'user',
    align: 'center',
    customRender({ text, record, index, column }) {
      return text.realName;
    }
  },
  {
    title: '就诊人',
    dataIndex: 'patient',
    key: 'patient',
    align: 'center',
    inSearch: true,
    customRender({ text, record, index, column }) {
      return text.name;
    }
  },
  {
    title: '服务',
    dataIndex: 'service',
    key: 'service',
    align: 'center',
    inSearch: true,
    component: 'Select',
    componentProps: {
      options: [{ value: 'sample', label: 'sample' }, { value: 'sample1', label: 'sample1' }, { value: 'sample2', label: 'sample2' }]
    },
    // customRender({ text, record, index, column }) {
    //   return text.name;
    // }
  },
  {
    title: '预约时间',
    dataIndex: 'startTime',
    key: 'startTime',
    align: 'center',
    inSearch: true,
    component: 'RangePicker',
    colProps: {
      span: 8,
    },
    customRender({ text, record, index, column }) {
      return format(text, 'YYYY-MM-DD HH:mm:ss');
    }
  },
  {
    title: '医院',
    dataIndex: 'hospital',
    key: 'hospital',
    align: 'center',
    inSearch: true,
    component: 'Select',
    componentProps: {
      options: [{ value: 'sample', label: 'sample' }, { value: 'sample1', label: 'sample1' }, { value: 'sample2', label: 'sample2' }]
    },
  },
  {
    title: '科室',
    dataIndex: 'department',
    key: 'department',
    align: 'center',
    
  },
  {
    title: '备注',
    dataIndex: 'note',
    key: 'note',
    align: 'left',
  },
  {
    title: '陪诊员性别',
    dataIndex: 'companionGender',
    key: 'companionGender',
    align: 'center',
    customRender({ text, record, index, column }) {
      return text.name;
    }
  },
  {
    title: '服务时长',
    dataIndex: 'serviceDuration',
    key: 'serviceDuration',
    align: 'center',

  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'status',
    align: 'center',
    inSearch: true,
    component: 'Select',
    componentProps: {
      options: [{ value: 'sample', label: 'sample' }, { value: 'sample1', label: 'sample1' }, { value: 'sample2', label: 'sample2' }]
    },
    // customRender({ text, record, index, column }) {
    //   return text.status;
    // }
  },
  {
    title: '创建时间',
    dataIndex: 'createdTime',
    key: 'createdTime',
    align: 'center',
    customRender({ text, record, index, column }) {
      return format(text, 'YYYY-MM-DD HH:mm:ss');
    }
  },

];

export const formSchemas = [
  {
    component: 'Input',
    label: 'ID',
    name: 'id',
    dataIndex: 'id',
    vShow: false,
  },
  {
    component: 'InputNumber',
    label: '用户ID',
    dataIndex: 'user_id',
    name: 'user_id',
  },
  {
    component: 'InputNumber',
    label: '就诊人ID',
    dataIndex: 'patient_id',
    name: 'patient_id',
  },
  {
    component: 'InputNumber',
    label: '服务ID',
    dataIndex: 'service_id',
    name: 'service_id',
  },
  {
    component: 'DatePicker',
    label: '预约时间',
    dataIndex: 'start_time',
    name: 'start_time',
    componentProps: { showTime: true },
  },
  {
    component: 'Input',
    label: '医院',
    dataIndex: 'hospital',
    name: 'hospital',
  },
  {
    component: 'Input',
    label: '科室',
    dataIndex: 'department',
    name: 'department',
  },
  {
    component: 'InputTextArea',
    label: '备注',
    dataIndex: 'note',
    name: 'note',
  },
  {
    component: 'InputNumber',
    label: '陪诊员性别',
    dataIndex: 'companion_gender',
    name: 'companion_gender',
  },
  {
    component: 'InputNumber',
    label: '服务时长',
    dataIndex: 'service_duration',
    name: 'service_duration',
  },
  {
    component: 'InputNumber',
    label: '状态',
    dataIndex: 'status',
    name: 'status',
  },

];
